﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace InsideDL
{
    public partial class frmMain : Form //MISControl.frmMatrix //Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        //Form mdiChildForm = new Form();


        private void button1_Click(object sender, EventArgs e)
        {
            //mdiChildForm.Show();

        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            // Set the IsMdiContainer property to true.
            //IsMdiContainer = true;

            //// Set the child form's MdiParent property to 
            //// the current form.
            //mdiChildForm.MdiParent = this;

            //// Call the method that changes the background color.
            //SetBackGroundColorOfMDIForm();

        }

        private void SetBackGroundColorOfMDIForm()
        {
            //foreach (System.Windows.Forms.Control ctl in this.Controls)
            //{
            //    if ((ctl) is MdiClient)

            //    // If the control is the correct type,
            //    // change the color.
            //    {
            //        ctl.BackColor = System.Drawing.Color.PaleGreen;
            //    }
            //}

        }

        private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Program.ShootDown();
        }

        protected void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item = sender as ToolStripMenuItem;
            Form frm = System.Activator.CreateInstance(Type.GetType(
                item.Tag.ToString())) as Form;
            try
            {
                //frm.ShowDialog();
                frm.MdiParent = this;
                frm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

        }


    }
}
